{% extends "notification/base.html" %}

{% load i18n %}
{% load bootstrap_tags %}

{% block head_title %}{% trans "Notification Settings" %}{% endblock %}

{% block body %}
    <h2>{% trans "Settings" %}</h2>
    
    <div class="notice_settings">
        {% url acct_email as email_url %}
        {% if user.email %}
            <p>
                {% trans "Primary email" %}:<br />
                <b>{{ user.email }}</b><br />
                ({% blocktrans %}change under <a href="{{ email_url }}">Account</a>{% endblocktrans %})
            </p>
        {% else %}
            <div class="alert-message warning">
                {% blocktrans %}
                You do not have a verified email address to which notices can be sent.
                You can add one by going to <a href="{{ email_url }}">Account</a>.
                {% endblocktrans %}
            </div>
        {% endif %}
        
        <form method="POST" action="">
            {% csrf_token %}
            <table class="notice_settings zebra-striped">
                <tr>
                    <th>{% trans "Notification Type" %}</th>
                    {% for header in notice_settings.column_headers %}
                        <th>{{ header }}</th>
                    {% endfor %}
                </tr>
                {% for row in notice_settings.rows %}
                    <tr>
                        <td>{% trans row.notice_type.display %}<br/>
                            <span class="notice_type_description">{% trans row.notice_type.description %}</span>
                        </td>
                        {% for cell in row.cells %}
                            <td>
                                <input type="checkbox" name="{{ cell.0 }}" {% if cell.1 %}checked="yes"{% endif %}/>
                            </td>
                        {% endfor %}
                    </tr>
                {% endfor %}
                <tr>
                    <td colspan="2"><button type="submit" class="btn primary">{% trans "Change" %}</button></td>
                </tr>
            </table>
        </form>
    </div>
{% endblock %}
